package item.lxp.execption;

import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

import java.util.HashMap;
import java.util.Map;

@RestControllerAdvice
public class CaseExceptionAdvice {

    @ExceptionHandler(value = {CaseExceptin.class})
    public Map<String,Object> handle(CaseExceptin e){
              Map<String,Object> a = new HashMap<String,Object>();
              a.put("code",e.getCode());
              a.put("msg",e.getMsg());
              return a;
    }

}
